set(KRATOS_GENERATE_PYTHON_STUBS OFF CACHE BOOL "Generate hints for binary python packages")

if (${KRATOS_GENERATE_PYTHON_STUBS})
    if(${CMAKE_VERSION} VERSION_LESS "3.20.0")
        install(CODE "message(WARNING \"Current cmake version is less than the required minimum cmake version of 3.20.0 for python stubs generation. Hence ignoring stubs generation...\")")
    else(${CMAKE_VERSION} VERSION_LESS "3.20.0")
        install(CODE "message(STATUS \"Trying to install python stub files to enable python hinting support for cpp libraries in IDEs...\")")
        cmake_path(CONVERT ${PYTHON_EXECUTABLE} TO_CMAKE_PATH_LIST CONVERTED_PY_EXEC)
        install(CODE "execute_process(COMMAND \"${CONVERTED_PY_EXEC}\" \"${CMAKE_CURRENT_SOURCE_DIR}/stub_generation.py\" \"${CMAKE_INSTALL_PREFIX}\" --quiet)")
    endif()
endif()
